export default class DeviceShadowData {
  // 设备ID
  device_id: string;
  // 设备影子相关信息数组（对应原数据中的shadow部分）
  shadow: DeviceShadowInfo[];

  constructor(device_id: string, shadow: DeviceShadowInfo[]) {
    this.device_id = device_id;
    this.shadow = shadow;
  }
}

class DeviceShadowInfo {
  // 服务ID
  service_id: string;
  // 期望属性信息
  desired: DesiredProperties;
  // 上报属性信息
  reported: ReportedProperties;
  // 版本号
  version: number;

  constructor(service_id: string, desired: DesiredProperties, reported: ReportedProperties, version: number) {
    this.service_id = service_id;
    this.desired = desired;
    this.reported = reported;
    this.version = version;
  }
}

class DesiredProperties {
  // 期望属性中的具体属性（示例中目前为null，可按需细化类型等）
  properties: any;
  // 期望属性对应的事件时间（示例中目前为null，可按需细化类型等）
  event_time: any;

  constructor(properties: any, event_time: any) {
    this.properties = properties;
    this.event_time = event_time;
  }
}

class ReportedProperties {
  // 上报属性中的各个具体属性集合
  properties: ReportedPropertyValues;
  // 上报属性对应的事件时间
  event_time: string;

  constructor(properties: ReportedPropertyValues, event_time: string) {
    this.properties = properties;
    this.event_time = event_time;
  }
}

class ReportedPropertyValues {

  tuig1: string;       // 灯状态：ON/OFF
  tuig2:string;
  tuig3:string;
  zfb:number;
  calo:number;
  sprite:number;
  chips:number

  constructor(tuig1: string, tuig2: string, calo: number, tuig3: string, zfb: number,
    sprite: number,chips:number) {
    this.tuig1 = tuig1;
    this.tuig2 = tuig2;
    this.calo = calo;
    this.tuig3 = tuig3;
    this.zfb = zfb;
    this.sprite = sprite;
    this.chips=chips
  }


}